<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<button onclick="transfer(1)">1</button>
<button onclick="transfer(2)">2</button>
<button onclick="transfer(3)">3</button>
<script type="text/javascript">
    function transfer(num){
        localStorage.setItem("number",num);
        location.href = "page2.html";
    }
</script>
</body>
</html>